package com.tanhua.model.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tanhua.model.db.Options;
import com.tanhua.model.db.Questions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

//问题实体类
@Data
@NoArgsConstructor
@AllArgsConstructor

public class QuestionsVo implements java.io.Serializable {


    private String id;              //主键id
    private String question;        //题目
    private List<OptionsVo> options; //试题

    public static QuestionsVo init(Questions questions) {
        QuestionsVo vo = new QuestionsVo();
        //copy用户属性
        BeanUtils.copyProperties(questions, vo);
        vo.setId(questions.getId().toString());
        //返回
        return vo;
    }

}